package com.bilicute.libman.controller;

import com.bilicute.libman.pojo.Result;
import com.bilicute.libman.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @所属包名: com.bilicute.libman.controller
 * @类名: InfoController
 * @作者: i囡漫笔
 * @描述: 信息统计
 * @创建时间: 2024-06-30 02:32
 */
@CrossOrigin
@RestController
@RequestMapping("/api/info")
public class InfoController {
    private InfoService infoService;
    @Autowired
    public void setInfoService(InfoService infoService) {
        this.infoService = infoService;
    }
    @GetMapping("/all")
    public Result<Map<String,Integer>> getAllNum(){
        Map<String,Integer> map = infoService.getAllNum();
        System.out.println(map);
        return Result.success(map);
    }

}
